package satb.base.controller;

import satb.base.Configuration;
import satb.base.DAO.ConfigurationDAO;

public class ConfigurationController {

	
	 /**Invoca o metodo selectAll() da classe CollarDAO.*/
    public Configuration configurationSearch() throws Exception
    {  
       ConfigurationDAO configuationDAO = new ConfigurationDAO();  
       return configuationDAO.configurationSearch();  
    }
    
    
    /**Invoca o metodo selectAll() da classe CollarDAO.*/
    public void configurationSave(Configuration config) 
    {  
       try 
       {
    	   ConfigurationDAO configurationDAO = new ConfigurationDAO();  
       
	       if(config.getId() == null)
	       {
	    	   configurationDAO.configurationInsert(config);
	       }
	       else
	       {
	    	   configurationDAO.configurationUpdate(config);
	       }
       }
       catch (Exception e) 
       {
    	   e.printStackTrace();
       }
    
    }
	
}
